package com.zzq.demo.hibernate.mapper;

import com.zzq.demo.hibernate.entity.Model;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author : zhaoziqian
 * @description :
 * @date : 2019/9/11 17:15
 */
public interface ModelMapper extends JpaRepository<Model, Long> {


//    /**
//     * 修改用户
//     *
//     * @param id
//     * @param mobile
//     * @return int
//     */
//    @Transactional(rollbackFor = Exception.class)
//    @Modifying
//    @Query(value = "update user set mobile = :mobile where id = :id", nativeQuery = true)
//    int updateModelById(@Param("id") Long id, @Param("mobile") Model mobile);
}
